<?php
class system_db_adapter_exception extends system_db_exception {
	
	protected $_chainedException = null;
	
	public function __construct($message = '', $code = 0, Exception $e = null) {
		if($e&&(0===$code)) {
			$code = $e->getCode();
		}
		parent::__construct($message, $code, $e);
	}
	
	public function hasChainedException() {
		return ($this->_previous!==null);
	}
	
	public function getChainedException() {
		return $this->getPrevious();
	}

}